import request from '@/axios';

export const getList = (current, size, params) => {
  return request({
    url: '/blade-crf/crf/list',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    },
  });
};

export const getDetail = id => {
  return request({
    url: '/blade-crf/crf/detail',
    method: 'get',
    params: {
      id,
    },
  });
};
export const getCrfDetail = id => {
  return request({
    url: '/blade-crf/crf/detail',
    method: 'get',
    params: {
      id,
    },
  });
};

export const remove = ids => {
  return request({
    url: '/blade-crf/crf/remove',
    method: 'post',
    params: {
      ids,
    },
  });
};

export const add = row => {
  return request({
    url: '/blade-crf/crf/submit',
    method: 'post',
    data: row,
  });
};

export const update = row => {
  return request({
    url: '/blade-crf/crf/submit',
    method: 'post',
    data: row,
  });
};
export const dictionary = code => {
  return request({
    url: '/blade-system/dict-biz/dictionary',
    method: 'get',
    params: {
      code,
    },
  });
};

// 共享
export const toShare = row => {
  return request({
    url: '/blade-crf/crf/toShare',
    method: 'post',
    params: row,
  });
};

// 备注
export const remark = row => {
  return request({
    url: '/blade-crf/crf/remark',
    method: 'post',
    params: row,
  });
};

// 锁定
export const lock = row => {
  return request({
    url: '/blade-crf/crf/lock',
    method: 'post',
    params: row,
  });
};

// 锁定
export const copy = row => {
  return request({
    url: '/blade-crf/crf/copy',
    method: 'post',
    params: row,
  });
};